<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>英雄列表</title>
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/list.css">
</head>
<body>
    <div class="container">
        <h1>英雄列表</h1>
        <hr>
        <div class="search" style="text-align:right">
            <form action="/heros" method="get">
                <input type="text" name="q" value="<%= q || '' %>"> <button>搜索</button>
            </form>
        </div>
        <hr>
        <!-- 英雄列表的容器 -->
        <div class="hero-list">
            <!-- 单个的英雄结构 -->
            <% for(let i=0;i<heros.length;i++){ %>
            <div class="hero-item">
                <!-- 英雄头像  -->
                <a href="/hero/<%= heros[i].id %>.html"><img src="http://cdn.xiaohigh.com<%= heros[i].image %>" alt=""></a>
                <!-- 英雄名字 -->
                <p><%= heros[i].name %></p>
            </div>
            <% } %>
        </div>
    </div>
</body>
</html>